function ajxGet(url, data, $state, fn){
		if(typeof data == "function") {
			fn = data;
			data = {};
		}
		if(data == ""){
			data = {};
		}
		$.getJSON(ip + url + "?callback=?", data, function(result) {
			if(result.code == 400) {
				$.alert(result.mes);
				return false;
			}
			if(result.code == 401) {
				$.alert('尚未登录或登录已过期', function() {
					$state.go("login");
				});
				return;
			}
			if(result.code == 402) {
				$.alert('手机号码未绑定', function() {
					$state.go("myCenter");
				});
				return;
			}
			if(result.code == 403) {
				$.alert('支付密码未绑定', function() {
					$state.go("myCenter");
				});
				return;
			}
			if(result.code == 404) {
				$.alert('该用户已被冻结', function() {
					$state.go("login");
				});
				return;
			}
			if(result.code == 405) {
				$.alert('你的账号在其它设备登录，如不是本人操作，请尽快核实修改密码！', function() {
					$state.go("login");
				});
				return;
			}
			fn(JSON.stringify(result));
		})

	}


/*

$.ajaxSetup({
	xhrFiled: {
		'withCredentials': true
	}
})

function ajxGet(url, data, $state, fn) {
	if(typeof data == "function") {
		fn = data;
		data = {};
	}
	if(data == "") {
		data = {};
	}
	$.ajax({
		type: "POST",
		url: ip + url,
		data: data,
		dataType: 'json',
		xhrFields: {
			withCredentials: true
		},
		crossDomain: true,
		success: function(result) {
			if(result.code == 400) {
				$.alert(result.mes);
				return;
			}
			if(result.code == 401) {
				$.alert('尚未登录或登录已过期', function() {
					$state.go("login");
				});
				return;
			}
			if(result.code == 402) {
				$.alert('手机号码未绑定', function() {
					$state.go("person");
				});
				return;
			}
			if(result.code == 403) {
				$.alert('支付密码未绑定', function() {
					$state.go("person");
				});
				return;
			}
			if(result.code == 404) {
				$.alert('该用户已被冻结', function() {
					$state.go("login");
				});
				return;
			}
			if(result.code == 405) {
				$.alert('你的账号在其它设备登录，如不是本人操作，请尽快核实修改密码！', function() {
					$state.go("login");
				});
				return;
			}
			fn(JSON.stringify(result));
		}

	});
}*/